<!DOCTYPE html>
<html>
<head>
    <title>货架管理</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">

        <div class="grid-btn">
            <div class="layui-row">
                <div class="layui-col-xs2">
                    <div class="layui-col-xs4 prop">
                        <span>货架名称</span>
                    </div>
                    <div class="layui-col-xs8 select-content">
                        <i-input v-model="search.shelveName"  />
                    </div>
                </div>
                <div class="layui-col-xs2">
                    <div class="layui-col-xs4 prop">
                        <span>货架编码</span>
                    </div>
                    <div class="layui-col-xs8 select-content">
                        <i-input v-model="search.unitCode"  />
                    </div>
                </div>
                <div class="layui-col-xs3">
                    <div class="layui-col-xs3 prop">
                        <span>所属货区</span>
                    </div>
                    <div class="layui-col-xs9 select-content">
                        <!--<i-input  v-model="search.departmentId"  />-->
                        <el-select v-model="search.goodsAreaId" placeholder="请选择" @change="selectChange()" >
                            <el-option
                                    v-for="item in goodsAreaList"
                                    :key="item.id"
                                    :label="item.areaName"
                                    :value="item.id">
                            </el-option>
                        </el-select>
                    </div>
                </div>
                <div class="layui-col-xs5">
                    <a class="btn btn-primary" @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
                    <a class="btn btn-primary" @click="reset"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs12">
                    <#if shiro.hasPermission("basics:bgoodsshelves:save")>
                    <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
                    </#if>
                    <#if shiro.hasPermission("basics:bgoodsshelves:info")>
                    <a class="btn btn-primary" @click="detail"><i class="fa fa-plus"></i>&nbsp;查看</a>
                    </#if>
                    <#if shiro.hasPermission("basics:bgoodsshelves:update")>
                    <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
                    </#if>
                    <#if shiro.hasPermission("basics:bgoodsshelves:delete")>
                    <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
                    </#if>
                    <a class="btn btn-primary" @click="print"><i class="fa fa-trash-o"></i>&nbsp;打印</a>
                </div>
            </div>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
       <!-- <form class="form-horizontal">
					<div class="form-group">
                        <div class="col-sm-2 control-label">货架名称</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="bGoodsShelves.shelveName" placeholder="货架名称"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">货架编号</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="bGoodsShelves.shelveCode" placeholder="货架编号"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">所属货区</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="bGoodsShelves.goodsAreaId" placeholder="所属货区"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">所属货区所在行</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="bGoodsShelves.goodsAreaRow" placeholder="所属货区所在行"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">所属货区所在列</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="bGoodsShelves.goodsAreaCol" placeholder="所属货区所在列"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">条形码</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="bGoodsShelves.barCode" placeholder="条形码"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">备注</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="bGoodsShelves.remark" placeholder="备注"/>
                        </div>
                    </div>
					
			<div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>-->
        <i-form  class="form-horizontal"  ref= 'bGoodsShelves' :model="bGoodsShelves"  :rules='ruleValidate' :label-width="110">
         <!--   <form-item label="所属仓库" v-if="title!='新增'"  >
                <i-input  v-model="bGoodsShelves.antennaName" disable  placeholder="请输入仓库名称"></i-input>
            </form-item>-->
            <form-item label="货架名称" prop='shelveName' >
                <i-input  v-model="bGoodsShelves.shelveName" :readonly="isShow"  placeholder="请输入货架名称"></i-input>
            </form-item>
            <form-item label="货架编码" prop='shelveCode' v-if="title!='新增'">
                <i-input  v-model="bGoodsShelves.shelveCode"  disabled  placeholder="请输入货架编码"></i-input>
            </form-item>
            <form-item>
                <span slot="label" class="redclass">*</span><span slot="label">规格</span>
                <!-- <i-input  v-model="bGoodsArea.areaName" :readonly="isShow"  placeholder="请输入货区名称"></i-input>-->
                <i-row>
                    <i-col span="11">
                        <form-item prop="specsRow">
                            <!--<i-input-number  :min="1"  :editable="isShow" v-model="bGoodsArea.specsCol"></i-input-number>-->
                            <el-input-number v-model="specsRow":min="1" :max="100" label="行" :disabled="isShow"></el-input-number>
                            <span>行</span>
                        </form-item>
                    </i-col>
                    <i-col span="11">
                        <form-item  prop="specsCol">
                            <!-- <i-input-number  :min="1" :editable="isShow"  v-model="bGoodsArea.specsRow"></i-input-number>-->
                            <el-input-number v-model="specsCol":min="1" :max="100" label="行" :disabled="isShow"></el-input-number>
                            <span>列</span>
                        </form-item >
                    </i-col>
                </i-row>
            </form-item>
            <form-item label="所属货区" prop='goodsAreaId'  >
                <el-select v-model="bGoodsShelves.goodsAreaId" :disabled ="isShow" placeholder="请选择" @change="selectChange()" style="width: 100%">
                    <el-option
                            v-for="item in goodsAreaList"
                            :key="item.id"
                            :label="item.areaName"
                            :value="item.id">
                    </el-option>
                </el-select>
            </form-item>
            <form-item label="所属货区所在行" prop='goodsAreaRow'>
                <i-input type="number"  v-model="bGoodsShelves.goodsAreaRow" :readonly="isShow"  placeholder="所属货区所在行" ></i-input>
            </form-item>
            <form-item label="所属货区所在列" prop='goodsAreaCol'>
                <i-input type="number"  v-model="bGoodsShelves.goodsAreaCol" :readonly="isShow"  placeholder="所属货区所在列" ></i-input>
            </form-item>
            <form-item label="条形码" prop='unitCode' v-if="title!='新增'">
                <i-input  v-model="bGoodsShelves.barCode" disabled  ></i-input>
            </form-item>
            <form-item label="是否启用" >
                <i-switch :disabled="isShow" @on-change="changeUsed"  v-model="isUsed" ></i-switch>
            </form-item>
            <form-item label="备注" prop="remark">
                <i-input v-model="bGoodsShelves.remark" :readonly="isShow"   type="textarea" v-autosize="{minRows: 2,maxRows: 5}"></i-input>
            </form-item>
            <form-item >
                <i-button type="primary" v-if="title!='详情'" @click="saveOrUpdate('bGoodsShelves')"  >确定</i-button>
                <i-button style="margin-left: 8px" @click="reload">返回</i-button>
            </form-item>

        </i-form>
    </div>
    <div  v-show="false"><!--v-show="false"-->
    <div id="print">
        <table>
            <tr>
                <th colspan="2">
                    <div><svg id="barcode1"></svg></div>
                </th>

            </tr>
            <tr>
                <th>
                    <div>
                        <span> 所属仓库：</span>
                    </div>
                </th>
                <td>
                    <div>
                        <p id="antennaName"></p>
                    </div>
                </td>
            </tr>
            <tr>

                <th>
                    <div>
                        <span> 所属货区：</span>
                    </div>
                </th>
                <td>
                    <div>
                        <p id="areaName"> </p>
                    </div>
                </td>
            </tr>
            <tr>

                <th>
                    <div>
                        <span> 货架名称：</span>
                    </div>
                </th>
                <td>
                    <div>
                        <p id="shelveName"> </p>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    <div>
                        <span> 货区编码：</span>
                    </div>
                </th>
                <td>
                    <div>
                        <p id="shelveCode"></p>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
</div>

<script src="${request.contextPath}/statics/js/modules/basics/bgoodsshelves.js?_${.now?long}"></script>
</body>
<style>
    .prop{
        padding: 3%;
    }
    .select-content{
        padding: 1%;
    }
    .redclass{
        content: '*';
        display: inline-block;
        margin-right: 4px;
        line-height: 1;
        font-family: SimSun;
        font-size: 12px;
        color: #ed4014;
    }
    .demo-spin-icon-load{
        animation: ani-demo-spin 1s linear infinite;
    }
</style>
</html>